//
//  WebViewController.swift
//  YJLabelDemo
//
//  Created by 杨永杰 on 2019/8/22.
//  Copyright © 2019年 YYongJie. All rights reserved.
//

import UIKit
import WebKit

class WebViewController: UIViewController {

    lazy var webView = WKWebView(frame: UIScreen.main.bounds)
    
    var urlString: String? {
        didSet {
            
            guard let urlString = urlString,
                let url = URL(string: urlString)
            else { return  }
            
            webView.load(URLRequest(url: url))
        }
    }    

    override func viewDidLoad() {
        super.viewDidLoad()

        view.addSubview(webView)
    }
}
